<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        // 1.获取字符串长度
        var str = 'my name';
        console.log(str.length);
        // 字符串的拼接   数值相加  字符相连
        console.log('沙漠' + '骆驼')
        console.log('沙漠' + 18)
        console.log(12 + 12)
        console.log('12' + 12)
        // 字符串变量相连  引引加加 变量不加引号
        var age = 21;
        console.log('我今年' + age + '岁')
    </script>
</head>

<body>

</body>

</html>